ia.BoundingBox Class
An area defined by its position, as indicated
by its bottom-left corner point (xMin
, yMin
)
and by its top-right corner point (xMax
, yMax
).
Constructor
ia.BoundingBox
-
[xMin=0]
-
[yMin=0]
-
[xMax=100]
-
[yMax=100]
Parameters:
-
[xMin=0]
Number optionalThe x-coord of the bottom-left corner.
-
[yMin=0]
Number optionalThe y-coord of the bottom-left corner.
-
[xMax=100]
Number optionalThe x-coord of the top-right corner.
-
[yMax=100]
Number optionalThe y-coord of the top-right corner.
Item Index
Methods
bottom
()
Number
Returns the bottom coord.
Returns:
clone
()
ia.BoundingBox
Gets a clone of this bounding box.
Returns:
contains
-
bBox
Tests whether a bounding box is contained within this one.
Parameters:
-
bBox
ia.BoundingBoxThe bounding box.
Returns:
equals
-
bBox
Tests whether a bounding box is equal to this one.
Parameters:
-
bBox
ia.BoundingBoxThe bounding box.
Returns:
getHeight
()
Number
Returns the height of the bounding box.
Returns:
getWidth
()
Number
Returns the width of the bounding box.
Returns:
getXCenter
()
Number
Returns the x-coord of the center of the bounding box.
Returns:
getXMax
()
Number
Returns the x-coord of the right edge of the bounding box.
Returns:
getXMin
()
Number
Returns the x-coord of the left edge of the bounding box.
Returns:
getYCenter
()
Number
Returns the y-coord of the center of the bounding box.
Returns:
getYMax
()
Number
Returns the y-coord of the top edge of the bounding box.
Returns:
getYMin
()
Number
Returns the y-coord of the bottom edge of the bounding box.
Returns:
intersects
-
bBox
Tests whether a bounding box intersects this one.
Parameters:
-
bBox
ia.BoundingBoxThe bounding box.
Returns:
left
()
Number
Returns the left coord.
Returns:
right
()
Number
Returns the right coord.
Returns:
setHeight
-
h
Sets the height of the bounding box.
Parameters:
-
h
NumberThe height.
setWidth
-
w
Sets the width of the bounding box.
Parameters:
-
w
NumberThe width.
setXCenter
-
x
Sets the x-coord of the center of the bounding box.
Parameters:
-
x
NumberThe coordinate.
setXMax
-
x
Sets the x-coord of the right edge of the bounding box.
Parameters:
-
x
NumberThe coordinate.
setXMin
-
x
Sets the x-coord of the left edge of the bounding box.
Parameters:
-
x
NumberThe coordinate.
setYCenter
-
y
Sets the y-coord of the center of the bounding box.
Parameters:
-
y
NumberThe coordinate.
setYMax
-
y
Sets the y-coord of the top edge of the bounding box.
Parameters:
-
y
NumberThe coordinate.
setYMin
-
y
Sets the y-coord of the bottom edge of the bounding box.
Parameters:
-
y
NumberThe coordinate.
top
()
Number
Returns the top coord.
Returns:
toString
()
String
Gets a simple text representation of this bounding box.